<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@ page import="com.conversationboard.model.*" %>
<%@ page import="com.conversationboard.view.*" %>
<%@ page import="com.conversationboard.config.*" %>

<%@page pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>

<% 
	String userId = request.getUserPrincipal().getName();
	User user = User.get(userId);
	String root = Configuration.getInstance().getRoot();
	request.setAttribute("user", user);
	request.setAttribute("root", root);
	
	String key = request.getSession().getId();
	request.setAttribute("key", key);
	
%>

<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>Admin Menu</title>
	<link rel="stylesheet" type="text/css" href="<%=Configuration.getInstance().getRoot()%>/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>">
</head>

	<%= MainMenu.display(request.getUserPrincipal()) %>

	<body>
	
		<div class="headingblock">
			<h1>Administration Menu</h1>
		</div>

		<div class="mainblock">
			
			<div class="formsectionlight">
		
				<c:if test="${user.siteAdmin}">
					<table class="table">
						<tr class="header"><td class="cell">Site Admin Menu</td></tr>
						<tr class="row"><td class="cell"><strong><a href="${root}/Admin/AdminInitialiseMessageCountsControllerServlet?key=${key}">Initialise Message Counts</a></strong></td></tr>
						<tr class="row"><td class="cell"><strong><a href="${root}/Admin/AdminFixApostrophesControllerServlet?key=${key}">Fix Apostrophes</a></strong></td></tr>
						<tr class="row"><td class="cell"><strong><a href="${root}/Admin/AdminSortUnansweredControllerServlet?key=${key}">Sort Unanswered</a></strong></td></tr>
						<tr class="row"><td class="cell"><strong><a href="${root}/Admin/AdminConsistencyCheckControllerServlet?key=${key}">Consistency Check</a></strong></td></tr>
						<tr class="row"><td class="cell"><strong><a href="${root}/Admin/AdminConsistencyCheckControllerServlet?fix=true&amp;key=${key}">Consistency Check &amp; Fix</a></strong></td></tr>
						<tr class="row"><td class="cell"><strong><a href="${root}/Admin/AdminInitialiseMessagePostCountsControllerServlet?key=${key}">Initialise Message Post Counts</a></strong></td></tr>
					</table>
				</c:if>
			
				<br />
			
			</div>
		</div>
	
		<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
		<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>--> 
		
	</body>

</html>
